SnipCode is a high-performance code repository platform. It features a Go backend and a React TypeScript frontend, designed with a decoupled architecture for security and scalability.
You must define your backend URL in the frontend directory.
- Go to
/frontend. - Create a
.envfile. - Add:
VITE_API_URL=http://localhost:8080.
The backend includes a built-in seeding mechanism to create initial administrator accounts. You can customize these credentials directly in the source code before running the server.
- Open
main.go. - Locate the
seedAdminUsers()function. - Change Usernames: Modify the
admins := []string{"admin", "admin2"}slice to your preferred usernames. - Change Password: Modify the
fixedPassword := "admin123"variable. - Set Roles: The system automatically assigns the
"admin"role to these users, granting them full access to the dashboard.
The system uses Bcrypt to hash these passwords securely before saving them to the database.
- Type-Safe UI: Built with React and TypeScript for reliable data handling.
- Fast API: Powered by Go (Gin Gonic) for low-latency responses.
- Auto-Seeding: Automatic creation of admin accounts upon first run via
seedAdminUsers(). - Security: Centralized JWT authentication handled in
storageService.ts.
go mod tidy
go run main.go
The server will initialize the SQLite database (app.db) and seed the admins.
cd frontend
npm install
npm run dev
- backend/: Handlers, Models, and Admin Seeding logic.
- frontend/: React Components (
.tsx) and Storage Services (.ts).
If you encounter errors, please open a GitHub issue or contact the developer directly for critical bug reports.
Developed by Karin