Alpha-Eye-BE makes use of an extendable async API using FastAPI, Pydantic V2, SQLAlchemy 2.0 and PostgreSQL:
FastAPI: modern Python web framework for building APIsPydantic V2: the most widely used data Python validation library, rewritten in Rust(5x-50x faster)SQLAlchemy 2.0: Python SQL toolkit and Object Relational MapperPostgreSQL: The World's Most Advanced Open Source Relational DatabaseRedis: Open source, in-memory data store used by millions as a cache, message broker and more.Docker ComposeWith a single command, create and start all the services from your configuration.
- ⚡️ Fully async
- 🚀 Pydantic V2 and SQLAlchemy 2.0
- 🔐 User authentication with JWT
- 🍪 Cookie based refresh token
- 🏬 Easy redis caching
- 👜 Easy client-side caching
- 👮 FastAPI docs behind authentication and hidden based on the environment
- 🦾 Easily extendable
- 🤸♂️ Flexible
- 🚚 Easy running with docker compose
- About
- Features
- Contents
- Prerequisites
- Usage
- Extending
- Running in Production
- Testing
- Contributing
- References
- License
- Contact
Start by using the template, and naming the repository to what you want.
To access all backend codes
cd Backend
Then clone the repository to your local machine:
Warning
Do not forget to place docker-compose.yml and Dockerfile in the root folder, while .env should be in the src folder.
ENVIRONMENT can be one of local, staging and production, defaults to local, and changes the behavior of api docs endpoints:
- local:
/docs,/redocand/openapi.jsonavailable - staging:
/docs,/redocand/openapi.jsonavailable for superusers - production:
/docs,/redocand/openapi.jsonnot available
To do it using docker compose, ensure you have docker and docker compose installed, then: While in the base project directory (FastAPI-boilerplate here), run:
docker compose upYou should have a web container, postgres container, a worker container and a redis container running.
Then head to http://127.0.0.1:8000/docs.
Test using poetry Install poetry:
pip install poetryInstall dependencies:
poetry-add-requirements. txtTest using venv
python -m venv venvsource venv/bin/activate
```sh
```sh
pip install -r requirements.txtTo run
uvicorn app.main:app --reloadIf you used docker compose, your setup is done. You just need to ensure that when you run (while in the base folder):
docker compose upSo you may skip to 5. Extending.
While in the root folder, run to start the application with uvicorn server:
poetry run uvicorn src.app.main:app --reloadTip
The --reload flag enables auto-reload once you change (and save) something in the project
Create the new entities and relationships and add them to the model
Note that this table is used to blacklist the JWT tokens (it's how you log a user out)
Warning
Note that since it inherits from Base, the new model is mapped as a python dataclass, so optional attributes (arguments with a default value) should be defined after required attributes.
If you are using docker compose, just running the following command should ensure everything is working:
docker compose upIf you are doing it from scratch, ensure your postgres and your redis are running, then
while in the root folder, run to start the application with uvicorn server:
poetry run uvicorn src.app.main:app --reloadThis project is a web application built with React.js, Vite, and Tailwind CSS. It provides a fast and efficient development environment for building modern web applications with a focus on performance and developer experience.
- React.js: A JavaScript library for building user interfaces.
- Vite: A build tool that focuses on speed and development experience for web projects.
- Tailwind CSS: A utility-first CSS framework for rapidly building custom designs.
Before running the project, make sure you have Node.js and npm installed on your machine.
- Clone the repository:
git clone
- Navigate into the project directory:
cd Frontend
- Install dependencies:
npm install
To start the development server, run:
bash npm run dev
This will start the Vite development server and open your default web browser to display the web application. The development server supports hot module replacement for fast development iteration.
To build the project for production, run:
bash npm run build
This command will build the project optimized for production deployment. The output will be generated in the dist directory.
Contributions are welcome! If you find any issues or have suggestions for improvement, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- React.js: https://reactjs.org/
- Vite: https://vitejs.dev/
- Tailwind CSS: https://tailwindcss.com/
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Mobile The mobile application is developed with Flutter and is located in the mobile directory. To run the mobile app, navigate to the mobile directory and fetch the dependencies:
To run the mobile app
cd Mobile
to get all dependencies
flutter pub get
to run the application
flutter run
