This project is a simple CRUD (Create, Read, Update, Delete) application developed using the FARM stack (FastAPI, React, MongoDB). It facilitates the creation and versioning of scripts, storing them in a comprehensive change history. Additionally, the application allows for efficient script filtering directly from the database.
- Docker Desktop installed on your machine.
The application is dockerized for easy deployment in a multi-container setup. Follow these steps:
- Navigate to the root of the project.
- Run the containers:
docker-compose up -d
- Open your web browser and go to
http://localhost:3000
to interact with the application.
- Node.js (v20.10.0)
- Vite.js (v5.0.2)
- React.js (v18.2.0)
- Python (v3.12.0)
- Fastapi (v0.104.1)
- Uvicorn (v0.24.0.post1)
- Clone the Repository:
git clone https://github.com/your/repository.git
- Navigate to the project directory:
cd test-wiber
- Navigate to the backend directory:
cd Backend
- Creates virtual enviroment:
python -m venv venv
- Activate the vitual enviroment for Windows:
source venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt.
- Navigate to the frontend directory:
cd .. cd Frontend
- Install dependencies:
npm install
- Open a new terminal ( CMD ) and navigate to the backend directory
- Start the backend service:
uvicorn main:app --reload
- Open a new terminal ( Bash ) and navigate to the frontend directory
- Start the frontend:
npm run dev
- Open your browser and visit
http://localhost:3000
/backend
: Backend source code/frontend
: Frontend source code
The application comprises two primary sections. The first is the Welcome Section, serving as a static example page to provide a brief introduction. The second is the Dashboard Section, where users can seamlessly perform script management tasks. This includes creating, modifying, and deleting scripts using CRUD operations. Additionally, users can track script versions, gaining insights into changes over time. The Dashboard further offers a text-based search filter for efficient script retrieval based on content.
This project uses MongoDB Atlas as its database. Ensure you have an account on MongoDB Atlas and follow these steps:
- Create a cluster in MongoDB Atlas.
- Configure your cluster's security by allowing access from any IP address (0.0.0.0/0) or adjust it according to your security needs.
- Create a database user with the necessary permissions.
- Get the MongoDB Atlas connection string. It should have a format similar to:
mongodb+srv://<username>:<password>@cluster0.mongodb.net/<database_name>?retryWrites=true&w=majority
Remember to update the connection details in both the backend configuration and the Docker Compose file to link it with your desired database.
- This project structure may not work with Node.js versions below 14.
- Please be aware that the setup of the virtual environment may vary based on the operating system.
- Additionally, ensure that Vite is included among the development dependencies.
- Dockerfiles include tools for making requests between containers and verifying their connection.
For any questions or issues, feel free to reach out at
federicorouyere@gmail.com
Contributions are welcome! Please follow the standard contribution workflow.