Skip to content

Commit 66b02f0

Browse files
committed
chore: Update readme
1 parent a372206 commit 66b02f0

File tree

2 files changed

+38
-51
lines changed

2 files changed

+38
-51
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
.vscode
33
.envrc
44
.envr
5-
securechain-login-env
65

76
# Byte-compiled / optimized / DLL files
87
__pycache__/
@@ -115,6 +114,7 @@ venv/
115114
ENV/
116115
env.bak/
117116
venv.bak/
117+
auth-env/
118118

119119
# Spyder project settings
120120
.spyderproject

README.md

Lines changed: 37 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,58 @@
22

33
A simple user registry backend for Secure Chain tools, built with FastAPI. This service provides user authentication, registration, password management, and token-based security, with support for MongoDB and Neo4j databases.
44

5-
## Requirements
6-
- Python 3.10+
7-
- MongoDB & MongoDB Compass
8-
- Neo4j
9-
- Docker
5+
## Development requirements
6+
7+
1. [Docker](https://www.docker.com/) to deploy the tool.
8+
2. [Docker Compose](https://docs.docker.com/compose/) for container orchestration.
9+
3. It is recommended to use a GUI such as [MongoDB Compass](https://www.mongodb.com/en/products/compass).
10+
4. Python 3.13 or higher.
1011

1112
## Setup development profile
1213

1314
### 1. Clone the repository
1415
```bash
15-
git clone https://github.com/securechaindev/login_backend.git
16-
cd login_backend
16+
git clone https://github.com/securechaindev/securechain-auth.git
17+
cd securechain-auth
1718
```
1819

19-
### 2. Install dependencies
20-
```bash
21-
python -m venv securechain-login-env
22-
source securechain-login-env/bin/activate
23-
pip install -r requirements.txt
24-
```
20+
### 2. Configure environment variables
21+
Create a `.env` file from the `template.env` file and place it in the `app/` directory. Modify the **Json Web Token (JWT)** secret key and algorithm with your own. You can generate your own secret key with the command **openssl rand -base64 32**.
2522

26-
### 3. Configure environment variables
27-
Copy the template and fill in your secrets:
28-
```bash
29-
cp template.env app/.env
30-
```
31-
Edit `.env` with your database URIs, credentials, and JWT secrets. Example:
32-
```
33-
GRAPH_DB_URI='bolt://localhost:7687'
34-
VULN_DB_URI='mongodb://mongoSecureChain:mongoSecureChain@localhost:27017/admin'
35-
GRAPH_DB_USER='neo4j'
36-
GRAPH_DB_PASSWORD='neoSecureChain'
37-
VULN_DB_USER='mongoSecureChain'
38-
VULN_DB_PASSWORD='mongoSecureChain'
39-
ALGORITHM='HS256'
40-
ACCESS_TOKEN_EXPIRE_MINUTES=15
41-
REFRESH_TOKEN_EXPIRE_DAYS=7
42-
JWT_ACCESS_SECRET_KEY='your_access_secret_key'
43-
JWT_REFRESH_SECRET_KEY='your_refresh_secret_key'
44-
SECURE=False # Set to True in production
45-
```
46-
You can generate secure keys with:
23+
### 3. Create Docker network
24+
Ensure you have the `securechain` Docker network created. If not, create it with:
4725
```bash
48-
openssl rand -base64 32
26+
docker network create securechain
4927
```
5028

51-
### 4. Build and run with Docker Compose as dev
29+
### 4. Start the application
30+
Run the command from the project root:
5231
```bash
53-
docker-compose -f dev/docker-compose.yml up --build
32+
docker compose -f dev/docker-compose.yml up --build
5433
```
55-
This will build the backend and expose it on port 8001 (mapped to 8000 inside the container).
5634

57-
## API Overview
35+
### 5. Access the application
36+
The API will be available at [http://localhost:8001](http://localhost:8002). You can access the API documentation at [http://localhost:8001/docs](http://localhost:8002/docs).
37+
38+
## Python Environment
39+
The project uses Python 3.13 and the dependencies are listed in `requirements.txt`.
40+
41+
### Setting up the development environment
42+
43+
1. **Create a virtual environment**:
44+
```bash
45+
python3.13 -m venv auth-env
46+
```
5847

59-
### Authentication Endpoints
60-
- `POST /auth/signup` — Register a new user
61-
- `POST /auth/login` — Login and receive access/refresh tokens
62-
- `POST /auth/logout` — Logout and revoke refresh token
63-
- `POST /auth/account_exists` — Check if an account exists
64-
- `POST /auth/change_password` — Change user password
65-
- `POST /auth/check_token` — Verify access token
66-
- `POST /auth/refresh_token` — Refresh access token
48+
2. **Activate the virtual environment**:
49+
```bash
50+
source auth-env/bin/activate
51+
```
6752

68-
### Health Check
69-
- `GET /health` — Returns `{ "code": "healthy" }` if the service is running
53+
3. **Install dependencies**:
54+
```bash
55+
pip install -r requirements.txt
56+
```
7057

7158
## Testing
7259

@@ -84,7 +71,7 @@ pytest tests
8471
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
8572

8673
## License
87-
[Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
74+
[GNU General Public License 3.0](https://www.gnu.org/licenses/gpl-3.0.html)
8875

8976
## Links
9077
- [Secure Chain Team](mailto:hi@securechain.dev)

0 commit comments

Comments
 (0)