A Stock Community App for NestJS Learning & Tutorial Materials
This project was created as educational material for NestJS backend development course. It demonstrates modern web development practices with a Toss-inspired UI and real-time stock community features.
Alice Stock Community is a modern stock discussion platform inspired by popular fintech apps like Toss. Users can view real-time stock prices, charts, and participate in community discussions with automatic sentiment analysis.
π Educational Purpose: This repository serves as comprehensive learning material for NestJS backend development, covering API design, data validation, real-time updates, and modern TypeScript patterns.
- Real-time stock price simulation (ALICE CORP)
- Interactive price charts with Canvas API
- NVIDIA-style bullish trend simulation
- Live market statistics and trading volume
- Real-time message posting and updates
- Automatic sentiment analysis (bullish/bearish detection)
- Live notifications for new community posts
- Keyword-based mood indicators (π bullish, π bearish)
- Toss-inspired design system
- Clean white-based interface
- Fully responsive mobile-first design
- Smooth animations and micro-interactions
- Vanilla JavaScript with modern ES6+ features
- HTML5 Canvas for stock chart visualization
- CSS3 with custom properties and modern layouts
- Responsive Design with mobile-optimized breakpoints
- NestJS Framework with TypeScript
- REST API with proper HTTP methods
- Data Validation using class-validator
- In-memory storage (ready for database integration)
- Sentiment Analysis with keyword detection
- CORS enabled for frontend integration
- Node.js (v16 or higher)
- npm or yarn
-
Clone the repository
git clone <your-repository-url> cd alice-stock-community
-
Backend Setup
cd backend npm install npm run start:dev
Backend will run on
http://localhost:3000
-
Frontend Setup
cd frontend # Simply open index.html in your browser # or use a local server: npx serve .
Method | Endpoint | Description |
---|---|---|
GET |
/messages |
Fetch all community messages |
POST |
/messages |
Create a new community message |
POST /messages
{
"nickname": "InvestorJoe",
"text": "ALICE μ£Όκ° μμΉ μμ! π"
}
Response
{
"id": "1691234567890abc",
"nickname": "InvestorJoe",
"text": "ALICE μ£Όκ° μμΉ μμ! π",
"sentiment": "bullish",
"createdAt": "2024-08-10T15:30:00.000Z"
}
This project covers essential NestJS concepts:
- Project Structure - Understanding NestJS modular architecture
- Controllers - Handling HTTP requests and responses
- Services - Business logic separation and dependency injection
- DTOs - Data validation and transformation
- Modules - Feature-based code organization
- Middleware - CORS, validation pipes, and error handling
- Database Integration - TypeORM or Prisma setup
- Authentication - JWT and user management
- Real-time Features - WebSocket implementation
- External APIs - Stock data integration
- Testing - Unit and integration tests
- Deployment - Docker and cloud deployment
alice-stock-community/
βββ frontend/ # Frontend application
β βββ index.html # Main HTML file
β βββ style.css # Toss-inspired styles
β βββ script.js # Stock app logic
βββ backend/ # NestJS backend
β βββ src/
β β βββ main.ts # Application entry point
β β βββ app.module.ts # Root module
β β βββ messages/ # Messages feature module
β β βββ messages.module.ts
β β βββ messages.controller.ts
β β βββ messages.service.ts
β β βββ create-message.dto.ts
β βββ package.json
β βββ tsconfig.json
βββ README.md
The app automatically detects bullish/bearish sentiment using keyword matching:
- Bullish keywords: "μμΉ", "μ€λ₯Έλ€", "λ§€μ", "π", "π"
- Bearish keywords: "νλ½", "λ¨μ΄", "λ§€λ", "π", "πΈ"
- 70% chance of small gains (+0.2% ~ +1.7%)
- 5% chance of big rallies (+2% ~ +8%)
- 20% chance of sideways movement (Β±0.2%)
- 5% chance of minor corrections (-0.8%)
- Database integration (PostgreSQL/MongoDB)
- Real stock API integration
- User authentication system
- WebSocket for real-time updates
- Advanced sentiment analysis with AI
- Mobile app development
- Automated testing suite
This is an educational project. Feel free to fork, experiment, and submit pull requests with improvements!
This project is created for educational purposes. Feel free to use it for learning and teaching NestJS development.
- Inspired by Toss and other modern fintech applications
- Built with β€οΈ for NestJS learning community
- Special thanks to the NestJS team for the amazing framework
Happy Coding! π
This project demonstrates that learning backend development can be both practical and fun. Dive into the code, experiment with new features, and build your NestJS expertise!