This project is a Todoist clone application that consists of two parts: a frontend built with React and a backend built with Python, FastAPI framework, and PostgreSQL database. The frontend project is located in the frontend/
directory in the root of the backend.
- Install PostgreSQL and create a new database.
- Set the environment variables in your terminal:
export POSTGRES_DB=your_db_name
export POSTGRES_PORT=your_db_port
export POSTGRES_USER=your_db_username
export POSTGRES_PASSWORD=your_db_password
- Run the following command to start a PostgreSQL container:
docker run --name pgdb --rm -e POSTGRES_USER="$POSTGRES_USER" -e POSTGRES_PASSWORD="$POSTGRES_PASSWORD" -e POSTGRES_DB="$POSTGRES_DB" postgres
- Create a new
.env
file in the project root directory and add the following environment variables:
APP_ENV=dev
DATABASE_URL=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB
SECRET_KEY=$(openssl rand -hex 32)
- Run the following command to apply database migrations:
alembic upgrade head
- Run the following command to start the backend server:
uvicorn app.main:app --reload
- Change directory to
frontend/
:
cd frontend/
- Install the dependencies:
npm install
- Start the development server:
npm start
- Clone the repository:
git clone https://github.com/yourusername/todoist-clone.git
- Navigate to the project root directory:
cd todoist-clone/
- Set the environment variables in your terminal:
export POSTGRES_DB=your_db_name
export POSTGRES_PORT=your_db_port
export POSTGRES_USER=your_db_username
export POSTGRES_PASSWORD=your_db_password
- Create a new
.env
file in the project root directory and add the following environment variables:
APP_ENV=dev
DATABASE_URL=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB
SECRET_KEY=$(openssl rand -hex 32)
- Run the following command to start the project with Docker:
docker-compose up --build
- Access the frontend in your browser at
http://localhost:8000
and the backend API athttp://localhost:8000/api/
.
This project is licensed under the MIT License.