- Introduction
- System Architecture
- Frontend (React)
- Backend (FastAPI)
- API Endpoints
- Database
- Authentication
- Deployment
- Testing
- Contributing
WanderLuxe Ventures is a blog website built with React for the frontend and FastAPI for the backend. This documentation provides an overview of the project structure, key components, and development guidelines.
WanderLuxe Ventures follows a client-server architecture:
- Frontend: React (Single Page Application)
- Backend: FastAPI (Python-based REST API)
- Database: PostgreSQL
- Authentication: JWT (JSON Web Tokens)
The React frontend is organized as follows:
src/
|-- components/
| |-- navbar/
| |-- footer/
| |-- side-menu/
|-- pages/
| |-- home/
| |-- about/
| |-- blogs/
| |-- destinations/
| |-- contact/
|-- App.js
|-- index.js
- Header: Contains the navigation menu and logo.
- Footer: Displays copyright information and social media links.
- BlogPost: Renders individual blog posts.
- BlogList: Displays a list of blog posts.
- CommentSection: Allows users to view and add comments to blog posts.
- AuthForm: Handles user registration and login.
- UserProfile: Displays and allows editing of user information.
We use React Router for navigation. Main routes include:
/
: Home page/blog
: Blog list page/blog/:id
: Individual blog post page/about
: About page/contact
: Contact page/login
: Login page/register
: Registration page/profile
: User profile page
We use a combination of React Context API and local component state for state management. The main contexts are:
- AuthContext: Manages user authentication state.
- BlogContext: Manages global blog post state.
We use a tailwind and react-icons along with v0.dev
(This section is under development. The following is a placeholder structure.)
backend/
|-- app/
| |-- api/
| |-- core/
| |-- db/
| |-- models/
| |-- schemas/
|-- tests/
|-- main.py
(This section is under development. The following are placeholder endpoints.)
GET /api/posts
: Retrieve all blog postsGET /api/posts/{id}
: Retrieve a specific blog postPOST /api/posts
: Create a new blog postPUT /api/posts/{id}
: Update a blog postDELETE /api/posts/{id}
: Delete a blog postPOST /api/auth/register
: Register a new userPOST /api/auth/login
: Login a user
We use PostgreSQL as our database. The main tables are:
- users: Stores user information
- posts: Stores blog post data
- comments: Stores comments on blog posts
(Detailed schema will be provided once the backend development is complete.)
We use JWT (JSON Web Tokens) for authentication. The authentication flow is as follows:
- User registers or logs in
- Server validates credentials and returns a JWT
- Client stores the JWT in local storage
- Client includes the JWT in the Authorization header for subsequent requests
The React frontend is deployed on Vercel. To deploy:
- Push your changes to the main branch of the GitHub repository
- Vercel will automatically build and deploy the changes
(This section will be completed once the backend development is finished.)
We use Jest and React Testing Library for frontend testing. To run tests:
npm test
(This section will be completed once the backend development is finished.)
- Fork the repository
- Create a new branch:
git checkout -b this-repo
- Make your changes and commit them:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature-branch-name
- Submit a pull request
Please ensure that your code follows the project's coding standards and includes appropriate tests.
This documentation is a living document and will be updated as the project evolves. For any questions or clarifications, please contact me.